from core import UncompressTool
from core.CrackingStatusMonitor import cracking_status_monitor


def uncompress_by_password_list(compressed_file_path, password_generator):
    for password in password_generator:
        cracking_status_monitor.update_status({'password': password, 'tip': True})

        if UncompressTool.uncompress(compressed_file_path, password):
            return password
